home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 5542 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.5 KB

  1. Path: nef.ens.fr!drakkar!espie
  2. From: espie@drakkar.ens.fr (Marc Espie)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: FindTask() VERY IMPORTANT
  5. Date: 16 Mar 1996 14:42:04 GMT
  6. Organization: Ecole Normale Superieure, Paris
  7. Message-ID: <4iejvs$1b1@nef.ens.fr>
  8. References: <4hp3cv$cqe@serpens.rhein.de> <4i64pk$ia1@news.xs4all.nl> <4i74pb$b4f@serpens.rhein.de> <4ib9h0$i23@news.xs4all.nl>
  9. NNTP-Posting-Host: drakkar.ens.fr
  10.  
  11. In article <4ib9h0$i23@news.xs4all.nl>,
  12. Marco Nelissen <marcone@xs1.xs4all.nl> wrote:
  13. >Michael van Elst (mlelstv@serpens.rhein.de) wrote:
  14. >: I can only repeat myself:
  15. >
  16. >So I've noticed...
  17. >
  18. >: If there is a system function for a task then use it instead of peeking
  19. >: data structures.
  20. >
  21. >SysBase->ThisTask is _R_E_A_D_A_B_L_E_, and always has been. Why shouldn't
  22. >I use it? If this suddenly fails on a new OS, so be it, but it won't be my
  23. >fault.
  24.  
  25. `Programming is like sex. One mistake and you have to support it for life.'
  26.  
  27. should be more prominent in the Guru Book in my opinion.
  28. The developpers at old Commodore have admitted time and time again that they
  29. made some mistakes in the design of AmigaOS. In the opinion of several, the
  30. biggest mistake they made was to allow the end-user to peek at many fields
  31. in system structures and even to fake some system structures...
  32.  
  33. Just look around, find some information. Check the evolution of dos.library,
  34. of graphics.library. Look at all the functions that were added just to be able
  35. to examine some system structures safely.
  36.  
  37. You probably don't remember all the time it took from 1.3 to 2.04, just to
  38. support these mistakes (one of the most difficult point was all the false
  39. seglists and user-built new processes...)
  40.  
  41. Look, this has been the OFFICIAL point of view for a lot of time now.
  42. Did you ever read the general programming guidelines at the start of the RKMs ?
  43. Did you ever read developper docs ?
  44.  
  45. With insight, one crucial rule they tried to enforce was:
  46.  
  47. IF THERE EXISTS A SYSTEM FUNCTION TO PEEK/POKE/CREATE AT A SYSTEM STRUCTURE,
  48. USE IT. DON'T ROLL YOUR OWN.
  49.  
  50. This is stated QUITE prominently if all `recent' docs coming from Commodore
  51. (RKM libraries 2.0, for instance).
  52.  
  53. Yes, you can look at SysBase->ThisTask, yes it probably won't break in the
  54. future. But... what is your point ? 
  55.  
  56. Bottomline is, it's bad programming practice, as established by the guys 
  57. who wrote the system.
  58. -- 
  59. [nosave]<http://www.eleves.ens.fr:8080/home/espie/index.html>
  60. microsoft network is EXPLICITLY forbidden to redistribute this message.
  61. `Moon purismu powa, make up.... Tsuki ni kawatte, oshiokiyo !'
  62.     Marc Espie (Marc.Espie@ens.fr)
  63.